#
# OMNeT++/OMNEST Makefile for MiXiM
#
# This file was generated with the command:
#  opp_makemake -f --nolink -O out -d radioState -d channelInfo -d power -d mapping -d nicTest -d testUtils -d coord -d basePhyLayer -d decider -d connectionManager -d baseMobility -d blackboard -L../out/$(CONFIGNAME)/tests/testUtils -L../out/$(CONFIGNAME)/base -L../out/$(CONFIGNAME)/tests/power/utils -L../out/$(CONFIGNAME)/modules
#

# C++ include paths (with -I)
INCLUDE_PATH = -I.

# Output directory
PROJECT_OUTPUT_DIR = ../out
PROJECTRELATIVE_PATH = tests
O = $(PROJECT_OUTPUT_DIR)/$(CONFIGNAME)/$(PROJECTRELATIVE_PATH)

# Object files for local .cc and .msg files
OBJS =

# Message files
MSGFILES =

#------------------------------------------------------------------------------

# Pull in OMNeT++ configuration (Makefile.inc or configuser.vc)

ifneq ("$(OMNETPP_CONFIGFILE)","")
CONFIGFILE = $(OMNETPP_CONFIGFILE)
else
ifneq ("$(OMNETPP_ROOT)","")
CONFIGFILE = $(OMNETPP_ROOT)/Makefile.inc
else
CONFIGFILE = $(shell opp_configfilepath)
endif
endif

ifeq ("$(wildcard $(CONFIGFILE))","")
$(error Config file '$(CONFIGFILE)' does not exist -- add the OMNeT++ bin directory to the path so that opp_configfilepath can be found, or set the OMNETPP_CONFIGFILE variable to point to Makefile.inc)
endif

include $(CONFIGFILE)

COPTS = $(CFLAGS)  $(INCLUDE_PATH) -I$(OMNETPP_INCL_DIR)
MSGCOPTS = $(INCLUDE_PATH)

#------------------------------------------------------------------------------
# User-supplied makefile fragment(s)
# >>>
# inserted from file 'makefrag':
# makefrag for "tests" directory of MiXiM
#
# this file automatically gets inserted into Makefiles generated by opp_makemake

# preserve default target
all: $(TARGET)

baseMobility_dir basePhyLayer_dir blackboard_dir channelInfo_dir connectionManager_dir coord_dir mapping_dir radioState_dir decider_dir: testUtils_dir

.PHONY: testUtils

# <<<
#------------------------------------------------------------------------------

# Main target

all: $(OBJS) submakedirs Makefile
	@# Do nothing

submakedirs:  radioState_dir channelInfo_dir power_dir mapping_dir nicTest_dir testUtils_dir coord_dir basePhyLayer_dir decider_dir connectionManager_dir baseMobility_dir blackboard_dir

.PHONY: radioState channelInfo power mapping nicTest testUtils coord basePhyLayer decider connectionManager baseMobility blackboard
radioState: radioState_dir
channelInfo: channelInfo_dir
power: power_dir
mapping: mapping_dir
nicTest: nicTest_dir
testUtils: testUtils_dir
coord: coord_dir
basePhyLayer: basePhyLayer_dir
decider: decider_dir
connectionManager: connectionManager_dir
baseMobility: baseMobility_dir
blackboard: blackboard_dir

radioState_dir:
	cd radioState && $(MAKE)

channelInfo_dir:
	cd channelInfo && $(MAKE)

power_dir:
	cd power && $(MAKE)

mapping_dir:
	cd mapping && $(MAKE)

nicTest_dir:
	cd nicTest && $(MAKE)

testUtils_dir:
	cd testUtils && $(MAKE)

coord_dir:
	cd coord && $(MAKE)

basePhyLayer_dir:
	cd basePhyLayer && $(MAKE)

decider_dir:
	cd decider && $(MAKE)

connectionManager_dir:
	cd connectionManager && $(MAKE)

baseMobility_dir:
	cd baseMobility && $(MAKE)

blackboard_dir:
	cd blackboard && $(MAKE)

.SUFFIXES: .cc

$O/%.o: %.cc
	@$(MKPATH) $(dir $@)
	$(CXX) -c $(COPTS) -o $@ $<

%_m.cc %_m.h: %.msg
	$(MSGC) -s _m.cc $(MSGCOPTS) $?

msgheaders: $(MSGFILES:.msg=_m.h)
	cd radioState && $(MAKE) msgheaders
	cd channelInfo && $(MAKE) msgheaders
	cd power && $(MAKE) msgheaders
	cd mapping && $(MAKE) msgheaders
	cd nicTest && $(MAKE) msgheaders
	cd testUtils && $(MAKE) msgheaders
	cd coord && $(MAKE) msgheaders
	cd basePhyLayer && $(MAKE) msgheaders
	cd decider && $(MAKE) msgheaders
	cd connectionManager && $(MAKE) msgheaders
	cd baseMobility && $(MAKE) msgheaders
	cd blackboard && $(MAKE) msgheaders

clean:
	-rm -rf $O
	-rm -f MiXiM MiXiM.exe libMiXiM.so libMiXiM.a libMiXiM.dll libMiXiM.dylib
	-rm -f ./*_m.cc ./*_m.h

	-cd radioState && $(MAKE) clean
	-cd channelInfo && $(MAKE) clean
	-cd power && $(MAKE) clean
	-cd mapping && $(MAKE) clean
	-cd nicTest && $(MAKE) clean
	-cd testUtils && $(MAKE) clean
	-cd coord && $(MAKE) clean
	-cd basePhyLayer && $(MAKE) clean
	-cd decider && $(MAKE) clean
	-cd connectionManager && $(MAKE) clean
	-cd baseMobility && $(MAKE) clean
	-cd blackboard && $(MAKE) clean

cleanall: clean
	-rm -rf $(PROJECT_OUTPUT_DIR)

depend:
	$(MAKEDEPEND) $(INCLUDE_PATH) -f Makefile -P\$$O/ -- $(MSG_CC_FILES)  ./*.cc
	-cd radioState && if [ -f Makefile ]; then $(MAKE) depend; fi
	-cd channelInfo && if [ -f Makefile ]; then $(MAKE) depend; fi
	-cd power && if [ -f Makefile ]; then $(MAKE) depend; fi
	-cd mapping && if [ -f Makefile ]; then $(MAKE) depend; fi
	-cd nicTest && if [ -f Makefile ]; then $(MAKE) depend; fi
	-cd testUtils && if [ -f Makefile ]; then $(MAKE) depend; fi
	-cd coord && if [ -f Makefile ]; then $(MAKE) depend; fi
	-cd basePhyLayer && if [ -f Makefile ]; then $(MAKE) depend; fi
	-cd decider && if [ -f Makefile ]; then $(MAKE) depend; fi
	-cd connectionManager && if [ -f Makefile ]; then $(MAKE) depend; fi
	-cd baseMobility && if [ -f Makefile ]; then $(MAKE) depend; fi
	-cd blackboard && if [ -f Makefile ]; then $(MAKE) depend; fi

# DO NOT DELETE THIS LINE -- make depend depends on it.

